import java.util.Scanner;

/**
 * Created by 14229 on 2020/2/27.
 */
public class Test08_09 {
    public static void main(String[] args) {
// To be or not to be
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符串：");
        String s = sc.nextLine();
        System.out.println("各个单词反转后为：");
        String[] split = s.split(" ");
        for (String s1 : split) {
            char[] chars = s1.toCharArray();
            for (int i = chars.length-1; i >=0 ; i--) {
                System.out.print(chars[i]);
            }
            System.out.print(" ");
        }

    }
}
